package com.itheima.controller;

import com.itheima.domain.User;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.awt.print.Book;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @description:
 * @author: 付益民
 * @create: 2020-09-27-15:08
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @PostMapping("/reg")
    @ResponseBody
    public Map login(@RequestBody User user) {
        System.out.println(user);
        Map<String, Object> mp = new HashMap<>();
        mp.put("flag", true);
        mp.put("message", "注册成功");
        return mp;
    }
}
